package com.sms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sms.mapper.FundsTypeMapper;
import com.sms.pojo.FundsType;
import com.sms.service.FundsTypeService;
import com.sms.util.SqlSessionFactoryUtil;
import lombok.Getter;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;
@Getter
public class FundsTypeServiceImpl extends ServiceImpl<FundsTypeMapper, FundsType> implements FundsTypeService {
    SqlSession sqlSession=null;
    @Override
    public FundsTypeMapper getBaseMapper() {
        SqlSessionFactory factory = SqlSessionFactoryUtil.getFactory();
        sqlSession=factory.openSession(true);
        FundsTypeMapper mapper = factory.getConfiguration().getMapper(FundsTypeMapper.class, sqlSession);
        return mapper;
    }

    @Override
    public List<FundsType> listFundsType() {
        return this.getBaseMapper().listFundsType();
    }
}
